<?php


namespace app\manager\controller;


use app\validate\Admin;
use support\Request;

class BaseController
{
    public function login(Request $request)
    {
        $username = $request->post('username');
        $password = $request->post('password');

        $data = [
            'username' => $username,
            'password' => $password
        ];

        // 验证器
        $validate = new Admin();
        if (!$validate->scene('login')->check($data)) {
            return json($validate->getError());
        }

        // 管理员登录

    }
}